/*  BEGIN_FILE_HDR
***********************************************************************************************
*   NOTICE                              
*   This software is the property of HiRain Technologies. Any information contained in this 
*   doc should not be reproduced, or used, or disclosed without the written authorization from 
*   HiRain Technologies.
***********************************************************************************************
*   File Name       : CanIf.h
***********************************************************************************************
*   Project/Product : Bootloader
*   Title           : CAN Interface Driver module Header File
*   Author          : ning.chen
***********************************************************************************************
*   Description     : Interface of CAN Driver                        
*
***********************************************************************************************
*   Limitations     : Only used for Bootloader.
*
***********************************************************************************************
*
***********************************************************************************************
*   Revision History:
* 
*   Version     Date          Initials      CR#          Descriptions
*   ---------   ----------    ------------  ----------   ---------------
*   1.0         2011/3/28     ning.chen     N/A          Original
*
***********************************************************************************************
* END_FILE_HDR*/


#ifndef CANIF_H
#define CANIF_H

#include "..\src\BSW\Comms\NM\CanIf\CanIf_Type.h"
#include "Can_Type.h"


#define CANIF_ENTER_CRITICAL_SECTION()
#define CANIF_LEAVE_CRITICAL_SECTION()

#define CANTPPHYRXPDUID      				0x18DAF3F9			//0x18DAF3F9
#define CANTPFUNRXPDUID      				0x18DBFFF9
#define CANTPTXPDUID         				0x18DAF9F3			//0x18DAF9F3

/* PDU ID ,only 1 tx pdu ,its pdu id is 0*/
#define CANIF_CANTXPDUID	    0U
/* only 1 tx can id*/
#define CANIF_TXPDU_CANID       0x422
/* only 2 rx can id*/
#define CANIF_RXPDU_CANID_1 	0x400
#define CANIF_RXPDU_CANID_2 	0x4ff
/* can id type*/
#define CANIF_TXPDU_CANIDTYPE     0  //standard id

#define CANIF_USED_CONTROLLER_NUM    1

extern void SysSleepApp(void); //10MS 
extern Std_ReturnType CanIf_Transmit(PduIdType CanTxPduId, const PduInfoType* PduInfoPtr );
extern void CanIf_TxConfirmation( PduIdType CanTxPduId );
extern void CanIf_RxIndication( uint8 Hrh, Can_IdType CanId, uint8 CanDlc,  uint8* CanSduPtr );

extern void Can_SetControllerMode(uint8 channelNum,Can_StateTransitionType Transition);

extern  FUNC(Std_ReturnType, CANIF_PUBLIC_CODE) CanIf_SetPduMode(uint8 ControllerId,CanIf_PduSetModeType PduModeRequest);
#endif
